package com.llseven.ai.spring.llseven.enumtype;

import cn.hutool.core.util.StrUtil;

/**
 * @author ywb
 * @date 2025-05-02 10:46
 */
public enum ModelType {
    WANX_T2I_TURBO("wanx2.1-t2i-turbo"),
    WANX_T2I_IMAGEEDIT("wanx2.1-t2i-imageedit"),
    WANX_V1("wanx-v1"),
    SD_V1_5("stable-diffusion-v1.5"),
    QWEN_TURBO("qwen-turbo"),

    SD_3_5_LARGE("stable-diffusion-3.5-large");
    
    private final String value;
    
    ModelType(String value) {
        this.value = value;
    }
    
    public String getValue() {
        return value;
    }
    
    public static ModelType fromString(String modelType) {
        if (StrUtil.isEmptyIfStr(modelType)){
            return SD_3_5_LARGE;
        }
        
        for (ModelType type : values()) {
            if (type.value.equalsIgnoreCase(modelType)) {
                return type;
            }
        }
        return SD_3_5_LARGE;
    }
    
}

